home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gas_251.zip / bin_251 / bfd / elf32-hppa.h < prev    next >
C/C++ Source or Header  |  1994-07-31  |  5KB  |  153 lines

  1. /* ELF32/HPPA support
  2.  
  3.    This file contains ELF32/HPPA relocation support as specified
  4.    in the Stratus FTX/Golf Object File Format (SED-1762) dated
  5.    February 1994.
  6.  
  7.    Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
  8.  
  9.    Written by:
  10.  
  11.    Center for Software Science
  12.    Department of Computer Science
  13.    University of Utah
  14.  
  15.    This file is part of BFD, the Binary File Descriptor library.
  16.  
  17.    This program is free software; you can redistribute it and/or modify
  18.    it under the terms of the GNU General Public License as published by
  19.    the Free Software Foundation; either version 2 of the License, or
  20.    (at your option) any later version.
  21.  
  22.    This program is distributed in the hope that it will be useful,
  23.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  24.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  25.    GNU General Public License for more details.
  26.  
  27.    You should have received a copy of the GNU General Public License
  28.    along with this program; if not, write to the Free Software
  29.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  30.  
  31. #ifndef _ELF32_HPPA_H
  32. #define _ELF32_HPPA_H
  33.  
  34. #include "libelf.h"
  35. #include "libhppa.h"
  36. #include "elf/hppa.h"
  37.  
  38. /* ELF/HPPA relocation types */
  39.  
  40. typedef enum
  41.   {
  42.     /* Address relocation types
  43.        These relocation types do simple base + offset relocations.  */
  44.  
  45.     R_PARISC_NONE = 0x00,
  46.     R_PARISC_DIR32 = 0x01,
  47.     R_PARISC_DIR21L = 0x02,
  48.     R_PARISC_DIR17R = 0x03,
  49.     R_PARISC_DIR17F = 0x04,
  50.     R_PARISC_DIR14R = 0x06,
  51.  
  52.     /* PC-relative relocation types
  53.        Typically used for calls.
  54.        Note PCREL17C and PCREL17F differ only in overflow handling.
  55.        PCREL17C never reports a relocation error.
  56.  
  57.        When supporting argument relocations, function calls must be
  58.        accompanied by parameter relocation information.  This information is 
  59.        carried in the ten high-order bits of the addend field.  The remaining
  60.        22 bits of of the addend field are sign-extended to form the Addend.
  61.  
  62.        Note the code to build argument relocations depends on the 
  63.        addend being zero.  A consequence of this limitation is GAS
  64.        can not perform relocation reductions for function symbols.  */
  65.     R_PARISC_PCREL21L = 0x0a,
  66.     R_PARISC_PCREL17R = 0x0b,
  67.     R_PARISC_PCREL17F = 0x0c,
  68.     R_PARISC_PCREL17C = 0x0d,
  69.     R_PARISC_PCREL14R = 0x0e,
  70.     R_PARISC_PCREL14F = 0x0f,
  71.  
  72.     /* DP-relative relocation types.  */
  73.     R_PARISC_DPREL21L = 0x12,
  74.     R_PARISC_DPREL14R = 0x16,
  75.     R_PARISC_DPREL14F = 0x17,
  76.  
  77.     /* Data linkage table (DLT) relocation types
  78.  
  79.        SOM DLT_REL fixup requests are used to for static data references
  80.        from position-independent code within shared libraries.  They are
  81.        similar to the GOT relocation types in some SVR4 implementations.  */
  82.  
  83.     R_PARISC_DLTREL21L = 0x1a,
  84.     R_PARISC_DLTREL14R = 0x1e,
  85.     R_PARISC_DLTREL14F = 0x1f,
  86.  
  87.     /* DLT indirect relocation types  */
  88.     R_PARISC_DLTIND21L = 0x22,
  89.     R_PARISC_DLTIND14R = 0x26,
  90.     R_PARISC_DLTIND14F = 0x27,
  91.  
  92.     /* Base relative relocation types.  Ugh.  These imply lots of state */
  93.     R_PARISC_SETBASE = 0x28,
  94.     R_PARISC_BASEREL32 = 0x29,
  95.     R_PARISC_BASEREL21L = 0x2a,
  96.     R_PARISC_BASEREL17R = 0x2b,
  97.     R_PARISC_BASEREL17F = 0x2c,
  98.     R_PARISC_BASEREL14R = 0x2e,
  99.     R_PARISC_BASEREL14F = 0x2f,
  100.  
  101.     /* Segment relative relocation types.  */
  102.     R_PARISC_TEXTREL32 = 0x31,
  103.     R_PARISC_DATAREL32 = 0x39,
  104.  
  105.     /* Plabel relocation types.  */
  106.     R_PARISC_PLABEL32 = 0x41,
  107.     R_PARISC_PLABEL21L = 0x42,
  108.     R_PARISC_PLABEL14R = 0x46,
  109.  
  110.     /* PLT relocations.  */
  111.     R_PARISC_PLTIND21L = 0x82,
  112.     R_PARISC_PLTIND14R = 0x86,
  113.     R_PARISC_PLTIND14F = 0x87,
  114.  
  115.     /* Misc relocation types.  */
  116.     R_PARISC_COPY = 0x88,
  117.     R_PARISC_GLOB_DAT = 0x89,
  118.     R_PARISC_JMP_SLOT = 0x8a,
  119.     R_PARISC_RELATIVE = 0x8b,
  120.     R_PARISC_UNIMPLEMENTED,
  121.   }
  122. elf32_hppa_reloc_type;
  123.  
  124. #define ELF_HOWTO_TABLE_SIZE    R_PARISC_UNIMPLEMENTED + 1
  125. #define N_PARISC_RELOCS        R_PARISC_UNIMPLEMENTED + 1
  126.  
  127. /* Define groups of basic relocations.  FIXME:  These should
  128.    be the only basic relocations created by GAS.  The rest
  129.    should be internal to the BFD backend.  
  130.  
  131.    The idea is both SOM and ELF define these basic relocation
  132.    types so they map into a SOM or ELF specific relocation 
  133.    as appropriate.  This allows GAS to share much more code
  134.    between the two target object formats.  */
  135.  
  136. #define R_HPPA_NONE            R_PARISC_NONE
  137. #define    R_HPPA                R_PARISC_DIR32
  138. #define    R_HPPA_GOTOFF            R_PARISC_DPREL21L
  139. #define    R_HPPA_PCREL_CALL        R_PARISC_PCREL21L
  140. #define R_HPPA_ABS_CALL            R_PARISC_DIR17F
  141. #define R_HPPA_COMPLEX            R_PARISC_UNIMPLEMENTED
  142.  
  143. elf32_hppa_reloc_type **hppa_elf_gen_reloc_type
  144.   PARAMS ((bfd *, elf32_hppa_reloc_type, int, int));
  145.  
  146. boolean elf32_hppa_size_stubs
  147.   PARAMS ((bfd *, bfd *, struct bfd_link_info *));
  148.  
  149. boolean elf32_hppa_build_stubs
  150.   PARAMS ((bfd *, struct bfd_link_info *));
  151.  
  152. #endif /* _ELF32_HPPA_H */
  153.